import { modelAdd, modelRemove } from './modelOpera.js';

let allObject = [];

class JKFrameAdd {
  constructor(scene) {
    const modelData = [
      { url: './fbx/第二排机柜.fbx', num: 1, x: 133, y: -37, z: 145 },
      { url: './fbx/JK架铭牌.fbx', num: 1, x: 135, y: 8, z: 163 },
      {
        url: './model/JK架.fbx', children: [
          // 第10排
          { num: 7, x: 125, y: 44, z: 140, offsetZ: -7 },
          // 第9排
          { num: 9, x: 125, y: 26, z: 140, offsetZ: -7 },
          // 第8排
          { num: 5, x: 125, y: 8, z: 140, offsetZ: -7 }
        ]
      },
      {
        url: ['./model/继电器本体.fbx', './model/继电器透明盒子.fbx'], children: [
          // 第4排
          { num: 2, x: 142, y: -42, z: 178, offsetZ: -6 },
          // 第3排
          { num: 4, x: 142, y: -60, z: 178, offsetZ: -6 }
        ]
      }
    ];
    new modelAdd(modelData, (group) => {
      group.position.set(40, 0, -30);
      scene.add(group);
      allObject = group;
    });
  }
}
class JKFrameRemove {
  constructor(scene) {
    new modelRemove(scene, allObject);
  }
}
export { JKFrameAdd, JKFrameRemove };